﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Runtime.Remoting.Contexts;
using System.Text;
using System.Threading.Tasks;

namespace DataModel.KaoShi
{
    public class EFKaoShiContext : DbContext
    {
        private DbContext EFDbContext;
        public EFKaoShiContext() : base("name=MyDB")
        {

        }
        /// <summary>
        /// 提交到数据库
        /// </summary>
        public override int SaveChanges()
        {
            try
            {
                return base.SaveChanges();

            }
            catch (Exception ex)
            {
                //保存日志
                //抛出异常
                throw new Exception(ex.Message, ex);
            }
        }
        public DbSet<Questions> Questions { get; set; }
    }
}
